﻿
@{
    ViewBag.Title = "海关编码》表单页面";
    Layout = "~/Views/Shared/_LayoutForm.cshtml";
}
<script type="text/javascript">

    var KeyValue = GetQuery('KeyValue');//主键
    $(function () {
        bindDataList("10006", "CURRENCY_CODE");//绑定币种
        bindDataList("10007", "MEASURE_CODE1");//绑定第一计量单位
        bindDataList("10007", "MEASURE_CODE2");//绑定第二计量单位

        InitControl();
    })
    //得到一个对象实体
    function InitControl() {
        if (!!GetQuery('KeyValue')) {
            AjaxJson("/CommonModule/BmsCustomItem/SetForm", { KeyValue: KeyValue }, function (data) {
                SetWebControls(data);
            });
        }
    }
    //保存事件
    function AcceptClick() {
        if (!CheckDataValid('#form1')) {
            return false;
        }
        var postData = GetWebControls("#form1");
        AjaxJson("/CommonModule/BmsCustomItem/SubmitForm?KeyValue=" + KeyValue, postData, function (data) {
            tipDialog(data.Message, 3, data.Code);
            top.frames[tabiframeId()].windowload();
            closeDialog();
        });
    }

    //加载数据字典
    function bindDataList(code, selectId) {
        AjaxJson("/CommonModule/BmsCustomItem/bindDataList?code=" + code, null, function (data) {
            var selid = $("#" + selectId);
            selid.append("<option value=''>请选择</option>");
            $.each(data,function (i) {
                selid.append("<option value='" + data[i].Code + "'>" + data[i].Name + "</option>");
            })
        });
    }




    //负责人自动补全 
    //function UserAutocomplete() {
    //    var $LeadingOfficialId = $("#LeadingOfficialId");
    //    $LeadingOfficialId.bind("keyup", function (e)
    //    {
    //        if (e.which != 13 && e.which != 40 && e.which != 38)
    //        { DataSource(); }
    //    }).focus(function () {
    //        $(this).select(); DataSource();
    //        });
    //    //上，下键盘回调
    //    autocompletekeydown("LeadingOfficialId", function (data)
    //    {
    //        $("#LeadingOfficialId").val(data.RealName)
    //    });
    //    //获取数据源
    //    function DataSource(){
    //        AjaxJson("/CommonModule/User/Autocomplete", {
    //            keywords: $LeadingOfficialId.val()
    //        }, function (DataJson) {
    //                var html = ""; $.each(DataJson, function (i) {
    //                    html += "<tr>";
    //                    html += '<td id="UserId" style="display: none;">' + DataJson[i].userid + '</td>';
    //                    html += '<td id="Code" style="width: 60px;">' + DataJson[i].code + '</td>';
    //                    html += '<td id="RealName" style="width: 80px;">' + DataJson[i].realname + '</td>';
    //                    html += '<td id="DepartmentName">' + DataJson[i].departmentname + '</td>';
    //                    html += "</tr>";
    //            });
    //            //点击事件回调
    //            autocomplete("LeadingOfficialId", $LeadingOfficialId.width() + "px", "200px", html, function (data) {
    //                $("#LeadingOfficialId").val(data.RealName)
    //            });
    //        });
    //    }
    //}
</script>
<form id="form1" style="margin: 1px">
    <div id="message" style="display: none"></div>
    <table class="form">

        <tr>
            <th class='formTitle'>HS_CODE：</th>
            <td class='formValue'>
                <input id="HS_CODE" maxlength=20 type="text" class="txt" datacol="yes" err="HS_CODE" checkexpession="Num"/>
            </td>
        </tr>
        <tr>
            <th class='formTitle'>HS_NO：</th>
            <td class='formValue'>
                <input id="HS_NO" maxlength=40 type="text" class="txt" />
            </td>
        </tr>
        <tr>
            <th class='formTitle'>SUB_CODE：</th>
            <td class='formValue'>
                <input id="SUB_CODE" maxlength=20 type="text" class="txt"/>
            </td>
        </tr>
        <tr>
            <th class='formTitle'>申报要素：</th>
            <td class='formValue'>
                <input id="ELEMENT_DEC" maxlength=400 type="text" class="txt" />
            </td>
        </tr>
        <tr>
            <th class='formTitle'>适用年份：</th>
            <td class='formValue'>
                <input id="YYYY" maxlength=4 type="text" class="txt" datacol="yes" err="适用年份" checkexpession="Num"/>
            </td>
        </tr>
        <tr>
            <th class='formTitle'>商品名称：</th>
            <td class='formValue'>
                <input id="ITEM_DESC" maxlength=1000 type="text" class="txt" />
            </td>
        </tr>
        <tr>
            <th class='formTitle'>货物说明：</th>
            <td class='formValue'>
                <input id="REMARK" maxlength=60 type="text" class="txt" />
            </td>
        </tr>
        <tr>
            <th class='formTitle'>普通税率：</th>
            <td class='formValue'>
                <input id="GENERAL_DUTY" maxlength=18 type="text" class="txt" />
            </td>
        </tr>
        <tr>
            <th class='formTitle'>最惠国税率：</th>
            <td class='formValue'>
                <input id="PREFERENTIAL_DUTY" maxlength=18 type="text" class="txt" />
            </td>
        </tr>
        <tr>
            <th class='formTitle'>曼协税率：</th>
            <td class='formValue'>
                <input id="BA" maxlength=18 type="text" class="txt" />
            </td>
        </tr>
        <tr>
            <th class='formTitle'>出口退税：</th>
            <td class='formValue'>
                <input id="EXPORT_TAX" maxlength=18 type="text" class="txt" />
            </td>
        </tr>
        <tr>
            <th class='formTitle'>国内货物税：</th>
            <td class='formValue'>
                <input id="EXCISE" maxlength=18 type="text" class="txt" />
            </td>
        </tr>
        <tr>
            <th class='formTitle'>增值税率：</th>
            <td class='formValue'>
                <input id="VALUE_ADDED_TAX" maxlength=18 type="text" class="txt" />
            </td>
        </tr>
        <tr>
            <th class='formTitle'>监管条件：</th>
            <td class='formValue'>
                <input id="MONITOR_TERM" maxlength=20 type="text" class="txt" />
            </td>
        </tr>
        <tr>
            <th class='formTitle'>监管说明：</th>
            <td class='formValue'>
                <input id="MONITOR_DESC" maxlength=200 type="text" class="txt" />
            </td>
        </tr>
        <tr>
            <th class='formTitle'>商检类别：</th>
            <td class='formValue'>
                <input id="IC_TYPE" maxlength=20 type="text" class="txt" />
            </td>
        </tr>
        <tr>
            <th class='formTitle'>第一计量单位：</th>
            <td class='formValue'>
                @*<input id="MEASURE_CODE1" maxlength=20 type="text" class="txt" />*@
                <select id="MEASURE_CODE1" class="select" style="width: 200px" datacol="yes" err="第一计量单位" checkexpession="Num"></select>
            </td>
        </tr>
        <tr>
            <th class='formTitle'>第二计量单位：</th>
            <td class='formValue'>
                @*<input id="MEASURE_CODE2" maxlength=20 type="text" class="txt" />*@
                <select id="MEASURE_CODE2" class="select" style="width: 200px" ></select>
            </td>
        </tr>
        <tr>
            <th class='formTitle'>单价下限：</th>
            <td class='formValue'>
                <input id="PRICE_REF" maxlength=18 type="text" class="txt" datacol="yes" err="单价下限" checkexpession="Num"/>
            </td>
        </tr>
        <tr>
            <th class='formTitle'>单价上限：</th>
            <td class='formValue'>
                <input id="PRICE_REF_H" maxlength=18 type="text" class="txt" />
            </td>
        </tr>
        <tr>
            <th class='formTitle'>币别：</th>
            <td class='formValue'>
                @*<input id="CURRENCY_CODE" maxlength=50 type="text" class="txt" />*@
                <select id="CURRENCY_CODE" class="select" style="width: 200px"  datacol="yes" err="币别" checkexpession="Num"></select>
            </td>
        </tr>
        <tr>
            <th class='formTitle'>项目定义：</th>
            <td class='formValue'>
                <input id="ITEM_DESC_EN" maxlength=1000 type="text" class="txt" />
            </td>
        </tr>


        <tr></tr>
    </table>
</form>  